<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class AgentRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        if(request()->method() == 'POST')
        {
            return [
                'company_name'     => 'required|between:3,10',
                //'address' => 'required',
                //'company_type'  => 'required',
            ];
        }else{
            return [
                'company_name'     => 'required|between:3,10',
                //'address'    => 'required',
                //'company_type'  => 'required',
            ];
        }
    }

    /**
     * 提示信息s
     * @return array
     */
    public function messages()
    {
        return [
            'company_name.required'     => '公司名不能为空',
            //'company_name.between'      => '公司名长度应该在3~10位之间',
            //'address.required' 			=> '公司地址不能为空',
            //'company_type.required'     => '公司类型不能为空',
        ];
    }
}
